﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VRacer;
using Microsoft.Windows.Controls.Ribbon;

namespace VRacer.Controls
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class MainWindow : RibbonWindow
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void RibbonCommand_StartGame_CanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            e.CanExecute = Business.Instance.Game == null || Business.Instance.Game.State != GameState.Started;
        }

        private void RibbonCommand_StartNetGame_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            Business.Instance.Game = new RemoteGame();
            Business.Instance.Page = Urls.NetPreferences;

        }

        private void RibbonCommand_StartLocalGame_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            Business.Instance.Game = new LocalGame();
            Business.Instance.Page = Urls.LocalPreferences;
        }

        private void RibbonCommand_StartQuickGame_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            Business.Instance.Game = new QuickGame();
            Business.Instance.Page = Urls.Game;
        }

        private void RibbonCommand_StartTutorialGame_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            Business.Instance.Game = new PracticeGame();
            Business.Instance.Page = Urls.TutorialPreferences;
        }

        private void RibbonCommand_ShowInstructions_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            Business.Instance.Page = Urls.Instructions;
        }

        private void RibbonCommand_StartTrackEditor_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            Business.Instance.Page = Urls.TrackEditor;
        }

        private void RibbonCommand_ShowHighscores_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            Business.Instance.Page = Urls.Highscores;
        }

    }
}
